package com.qf.kdxf.controller;

import com.qf.kdxf.entity.ResultData;
import com.qf.kdxf.service.NaturalLanguageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("naturalLanguage")
public class NaturalLanguageController {

    @Autowired
    NaturalLanguageService languageService;

    /**
     * 01-机器语言翻译
     *
     * @param from 源语种
     * @param to   目标语种
     * @param text 文本内容
     * @return
     */

    @RequestMapping("/translation")
    @ResponseBody
    public ResultData translation(String from,String to,String text) {
        System.out.println(from + to + text);
        ResultData result = languageService.getTranslation(from, to, text);
        return result;
    }
}
